﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace JQueryControlToolkit.Sample.Web.Samples
{
    public partial class ListSelector : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            var ajax = JQuery.Ajax();
            ajax.Url = tag.Autocomplete.Url;
            tag.Autocomplete.Url = null;
            ajax.Success = new DomOperation() { Code = "function(data){ response(data.d); }" };
            ajax.Data = new DomResult();
            ((DomResult)ajax.Data).AddOperation("", null, "{prefix: request.term}");
            ajax.Cache = false;
            tag.Autocomplete.Source = new DomResult();
            ((DomResult)tag.Autocomplete.Source).AddParameter("request");
            ((DomResult)tag.Autocomplete.Source).AddParameter("response");
            ((DomResult)tag.Autocomplete.Source).AddOperation("Ajax", ajax, "$.ajax");
        }
    }
}
